<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{messages.Student} #{messages.Information}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGrid columns="2" rendered="#{studentController.canUpdate}">
                    <h:outputText value="#{messages.Account}"/>
                    <h:outputText value="#{studentController.logined.name}"/>
                    <h:outputText value="#{messages.Firstname}"/>
                    <h:inputText value="#{studentController.logined.firstname}"/>
                    <h:outputText value="#{messages.Secondname}"/>
                    <h:inputText value="#{studentController.logined.secondname}"/>
                    <h:outputText value="#{messages.Email}"/>
                    <h:inputText value="#{studentController.logined.email}"/>
                    <h:outputText value="#{messages.Phone}"/>
                    <h:inputText value="#{studentController.logined.phone}">
                        <f:validateRegex for="telephone" pattern="((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)" />
                    </h:inputText>
                    <h:outputLabel value="我的积分"></h:outputLabel>
                    <h:outputLabel value="#{studentaccupointsControllerA.calculateStudentPoints(studentController.logined)}"></h:outputLabel>
                    <h:commandButton action="#{studentController.personalUpdate}" value="#{messages.Save}"/>
                    <h:commandButton action="#{studentController.setUpdate}" value="#{messages.Edit}"/>
                    <h:commandButton action="#{studentController.naviChangePassword()}" value="#{messages.Update}#{messages.Password}"
                                     immediate="true"/>
                </h:panelGrid>

                <h:panelGrid columns="2" rendered="#{!studentController.canUpdate}">
                    <h:outputText value="#{messages.Account}"/>
                    <h:outputText value="#{studentController.logined.name}"/>
                    <h:outputText value="#{messages.Firstname}"/>
                    <h:outputText value="#{studentController.logined.firstname}"/>
                    <h:outputText value="#{messages.Secondname}"/>
                    <h:outputText value="#{studentController.logined.secondname}"/>
                    <h:outputText value="#{messages.Email}"/>
                    <h:outputText value="#{studentController.logined.email}"/>
                    <h:outputText value="#{messages.Phone}"/>
                    <h:outputText value="#{studentController.logined.phone}"/>
                    <h:commandLink action="#{studentController.personalUpdate}" value="#{messages.Save}"/>
                    <h:commandLink action="#{studentController.setUpdate}" value="#{messages.Edit}"/>
                </h:panelGrid>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{messages.Class}"/> 
                    <h:outputLabel value="#{studentController.logined.schoolId.name}"/>
                    <h:outputLabel value="#{messages.Major}"/> 
                    <h:outputLabel value="#{studentController.logined.schoolId.majorid.name}"/>
                </h:panelGrid>
            </h:form>
        </ui:define>
    </ui:composition>
</html>

